$(function() {
	var receive = getQueryString("receive"); //领取优惠券
	var apply = getQueryString("apply"); //会员卡
	if(receive) {
		$("#succeed").show();
	} else if(apply) {
		$(".apply.mui-backdrop").show();
	}
	var app = new Vue({
		el: "#app",
		data: {
			Language: {},
		},
		methods: {
			Langes: function(v) {
				$.ajax({
					type: "get",
					dataType: "json",
					url: "../Langue/" + v + ".json",
					success: function(h) {
						app.Language = h;
					},
					error: function(e) {
						console.log("错误");
					}
				});
			}
		}
	});
	//首次加载语言
	if(localStorage.getItem("lanuage")) {
		app.Langes(localStorage.getItem("lanuage"));
	} else {
		app.Langes("en");
		localStorage.setItem("lanuage", "en"); //设置默认语言用于其他页面做首次处理
	}
	$("#hint").click(function() {
		$(this).hide();
	})
	$(" .mui-backdrop>img").click(function() {
		$(this).parent().hide();
		$(window).attr("location", "../Shop/Shop.html");
	})
	//支付成功后显示
	$("#pay input").click(function() {
		$("#get").parent().show();
	})
	//通过推荐优惠券领取
	$(" #draw div a").on("click", function() {
		$("#succeed").show();
	})
	//优惠券领取成功
	$(".draw a").click(function() {
		$("#succeed").show();
	})
	//领取成功后查看
	$("#succeed button").click(function() {
		$(window).attr("location", "../Ticket/Particulars.html?use=" + receive);
	})
	//会员卡领取成功后查看
	$(".apply.mui-backdrop button").click(function() {
		$(window).attr("location", "Card.html?apply");
	})
	//点击返回键

})